package com.tarena.lbs.content.dao.repository.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tarena.lbs.content.dao.mapper.CategoryMapper;
import com.tarena.lbs.content.dao.repository.CategoryRepository;
import com.tarena.lbs.content.pojo.po.ArticleCategoryPO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 周恒宇
 * @date 6/10
 */
@Slf4j
@Repository
public class CategoryRepositoryImpl implements CategoryRepository {
    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public PageInfo<ArticleCategoryPO> pageList() {
        QueryWrapper<ArticleCategoryPO> queryWrapper = new QueryWrapper<>();
        PageHelper.startPage(1, 10);
        List<ArticleCategoryPO> list = categoryMapper.selectList(queryWrapper);
        return new PageInfo<>(list);
    }
}
